$(function(){

 	
 	endtime = $("#starttime").html();
	if(endtime != undefined)
	{
		function endCD()
		{
			location.reload();
		}	

		endtime = new Date(endtime*1000);
		$('#timeleft').countdown({until: endtime, compact: true, format: 'MS', onExpiry: endCD});
	}

	endtimesmall = $("#starttimesmall").html();
	if(endtimesmall != undefined)
	{
		function endCD()
		{
			location.reload();
		}	

		endtimesmall = new Date(endtimesmall*1000);
		$('#timeleftsmall').countdown({until: endtimesmall, compact: true, format: 'MS', onExpiry: endCD});
	}

});